package com.fqgj.sentry.manage;

import com.fqgj.sentry.manage.dao.McLogDao;
import com.fqgj.sentry.manage.entity.McLogEntity;
import com.fqgj.sentry.manage.service.LogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * Created by ykpbean kangping.ying@yuntu-inc.com
 *
 * @description
 * @create 2017-07-15 下午8:33
 */

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    McLogDao logDao;

    @Override
    public Page<McLogEntity> selectLogListForPage(Long userId, String email,Integer pageNum,Integer pageSize) {
        HashMap<String, Object> param = new HashMap<>();
        param.put("userId",userId);
        param.put("email",email);
        Page<McLogEntity> page = PageHelper.startPage(pageNum, pageSize);
        logDao.selectLogList(param);
        return page;
    }

    @Override
    public void insertLog(McLogEntity logEntity) {
        logDao.insert(logEntity);
    }
}
